package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        System.out.println(main);
        doSome();
    }

    public static void doSome() {
        Thread t = Thread.currentThread();
        System.out.println("执行doSome方法的线程是：" + t);
        String name = t.getName();
        System.out.println("线程名字：" + name);
        long id = t.getId();
        System.out.println("id：" + id);
        int priority = t.getPriority();
        System.out.println("优先级：" + priority);
        boolean isDaemon = t.isDaemon();
        boolean isInterrupted = t.isInterrupted();
        boolean isAlive = t.isAlive();
        System.out.println("是否为守护线程：" + isDaemon);
        System.out.println("是否被中断：" + isInterrupted);
        System.out.println("是否活着：" + isAlive);
    }


}
